<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@include file="/context/mytags.jsp" %>
<t:base type="jquery,easyui,tools"></t:base>
<div id="main_typegroup_list" class="easyui-layout" fit="true">
  <div region="center" style="padding: 1px;">
    <t:datagrid name="officialWhList"  fitColumns="false" title="" actionUrl="pushRecordsController.do?miniOfficialWhDatagrid"
                fit="true" idField="articleId"  queryMode="group" pageSize="20">
      <t:dgCol title="id" field="articleId" hidden="true"></t:dgCol>
      <t:dgCol title="文章标题"   field="title" query="true"></t:dgCol>
      <t:dgCol title="作者名称"   field="consumerName" query="true"></t:dgCol>
      <t:dgCol title="分类标签"   field="factorColumnName" sortable="false" ></t:dgCol>
      <t:dgCol title="分类标签"   field="columns"  hidden="true"></t:dgCol>
      <t:dgCol title="文章类型"  field="articleType"  dictionary="articleType" ></t:dgCol>
      <t:dgCol title="文章发布者"   field="publisher.realName" ></t:dgCol>
      <t:dgCol title="文章发布时间"  formatter="yyyy-MM-dd hh:mm:ss" field="publishTime"></t:dgCol>
      <%--<t:dgCol title="审核"  field="status" dictionary="review" query="true" ></t:dgCol>--%>

    </t:datagrid>
  </div>
</div>


<script type="text/javascript">

  $(function() {
  });


  //多媒体格式化数据
  function mediaImgFormatter(val,row){

    var html="";

    var type = row.type;
    if(type != ""){

      type = parseInt(type);

    }
    switch (type){
      case 101:
        html=  '<a rel="example_group" href="'+val+'" title="'+row.alt+'"><img style="width: 30px;height: 30px;" alt="" src="'+val+'" /></a>'

        break;
      case 102:
        html=  '<a href=\'javascript:f_openPlayer("'+val+'");\' title="'+row.alt+'"><img style="width: 30px;height: 30px;" alt="" src="${defVideoImg}" /></a>'


        break;
      case 103:

        html=  '<a rel="example_group" href="'+val+'" title="'+row.alt+'"><img style="width: 30px;height: 30px;" alt="" src="${defFileImg}" /></a>'


        break;
      default :

        html=  '<a rel="example_group" href="${defImgUrl}" title="多媒体类型未定义"><img style="width: 30px;height: 30px;" alt="" src="${defImgUrl}" /></a>'

        break;

    }

    return html;


  }

  //快捷按钮操作
  function f_optButton(fname,buttonName){

    var isBoo = false;

    $("#officialWhListtb a").each(function(i){

      if($(this).html().indexOf(buttonName) > 0){

        $("iframe[name="+fname+"]",parent.document)[0].contentWindow.f_closeWindow();

        $(this).trigger("click");
        isBoo = true;
      }

    });

    return isBoo;

  }

</script>
